package string;

public class TrimDemo {
    public static void main(String[] args) {
        String str = "  hello       ";//str是不变对象
        String str1=str.trim();//去掉str前后的空格
        System.out.println(str1);//hello
    }
}
